#ifndef XBEE_H
#define XBEE_H

#include <mutex>
#include <atomic>
#include <string>
#include <deque>


// forward declarations
class Serial;


class Xbee
{
 public:
    Xbee(Serial *_pSerial);
    virtual ~Xbee();

    /// start reading from xbee
    void run();

    /// flag stop
    void stop();

    /// takes one line of text from xbee
    std::string popString();

 private:
    std::atomic<bool>           m_bRunning;
    Serial                      *m_pSerial;
    std::deque<std::string>     m_queueLines;
    mutable std::mutex          m_mutex;
};

#endif // XBEE_H
